<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html lang="zh-CN">

<head>
<meta charset="UTF-8">
<title>用户管理</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../style/bootstrap.css" />
<link rel="stylesheet" href="style/index.css" />
</head>

<body>
	<div class="container-fluid">
		<div class="row">
			<div class="col-md-12">
				<h1 class="page-header">
					用户管理 <small>用户列表</small>
				</h1>
			</div>
		</div>
		<div class="row">
			<div class="col-md-12">
				<!-- 用户列表--bootstrap高级表格使用 -->
				<div class="panel panel-default">
					<div class="panel-heading">用户列表</div>
					<div class="panel-body">
						<!--table-responsive响应式表格，会自动添加滚动条-->
						<div class="table-responsive">
							<input id="addAdmin" class="btn btn-success" type="button"
								value="添加用户"> <input class="btn btn-info" type="button"
								value="编辑用户"> <input class="btn btn-danger"
								type="button" value="删除用户">
							<table class="table">
								<thead>
									<tr>
										<th><input type="checkbox" value=""></th>
										<th>编号</th>
										<th>账号</th>
										<th>姓名</th>
										<th>联系方式</th>
										<th>角色</th>
										<th>最后登录日期</th>
										<th>创建日期</th>
										<th>状态</th>
									</tr>
								</thead>
								<tbody>
									<c:forEach items="${map.list}" var="admin">
										<tr class="odd gradeX">
											<th><input type="checkbox" value=""></th>
											<td>${admin.id}</td>
											<td>${admin.admin}</td>
											<td>${admin.adminName}</td>
											<td>${admin.mobile}</td>
											<td>${admin.role.roleName}</td>
											<td class="center">${admin.lastDate}</td>
											<td class="center">${admin.createDate}</td>
											<c:if test="${admin.isEnable==0}">
												<td class="center"><span
													class="glyphicon glyphicon-remove" style="color: red"></span>
												</td>
											</c:if>
											<c:if test="${admin.isEnable==1}">
												<td class="center"><span
													class="glyphicon glyphicon-ok" style="color: green"></span>
												</td>
											</c:if>
										</tr>
									</c:forEach>
								</tbody>
							</table>
						</div>

						<!--分页显示-->
						<div class="row">
							<div class="col-md-6">
								<div class="pagination" style="margin: 0px;" role="alert"
									aria-live="polite" aria-relevant="all">显示 1 到 ${map.pageNum} 页 记录数${map.count}</div>
							</div>
							<div class="col-md-6" style="text-align: right;">
								<ul class="pagination" style="margin: 0px;">
									<li><a href="#" aria-label="Previous"> <span
											aria-hidden="true">&laquo;</span>
									</a></li>
									<li><a href="#">1</a></li>
									<li><a href="#">2</a></li>
									<li><a href="#">3</a></li>
									<li><a href="#">4</a></li>
									<li><a href="#">5</a></li>
									<li><a href="#" aria-label="Next"> <span
											aria-hidden="true">&raquo;</span>
									</a></li>
								</ul>
							</div>
						</div>
						<!--分页显示-->
					</div>
				</div>
				<!--表格结束 -->
			</div>
		</div>
	</div>
</body>
<script type="text/javascript">
	document.querySelector("#addAdmin").onclick = function() {
		window.location.href = "/admin/AdminServlet?flag=add";
	}
</script>
</html>